<!-- 教学管理-班级学生-班级资料 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>
          
          <el-col :span="6">
            <el-form-item label="学校名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options5"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="所属年级">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <template v-if="showAll">
          <el-col :span="6">
            <el-form-item label="学年届">
              <el-input v-model="listQuery.fcatno" placeholder="学年届" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="班级名称">
              <el-input v-model="listQuery.fcatname" placeholder="班级名称" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="班主任">
              <el-input v-model="listQuery.fuser" placeholder="请输入班主任" clearable />
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="所属学院">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="所属专业">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
           <el-form-item label="状态">
            <el-select v-model="listQuery.fcustomno" placeholder="请选择"
              :disabled="$store.getters.userInfo.manufacturer">
              <el-option
                v-for="item in options3"
                :key="item.value"
                :label="item.label"
                :value="item.value">
              </el-option>
            </el-select>
          </el-form-item>
          </el-col>

          </template>

          <el-col :span="12">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" @click="getlist">查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="warning" icon="el-icon-upload2">导入</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FHOME" label="学校名称" ></el-table-column>
          <el-table-column prop="FYEAR" label="学年届"  width="85"></el-table-column>
          <el-table-column prop="FPARENTNO" label="所属年级" ></el-table-column>
          <el-table-column prop="FCATNO" label="班级编号" width="85"></el-table-column>
          <el-table-column prop="FCATNAME" label="班级名称"></el-table-column>
          <!-- <el-table-column prop="FPOINTNO" label="绑定场地"></el-table-column> -->
          <!-- <el-table-column prop="FSTUDNO" label="所属专业"></el-table-column> -->
          <el-table-column prop="FTEACH" label="班主任" width="95"></el-table-column>
          <el-table-column prop="FNOTE" label="班级格言"></el-table-column>
          <el-table-column fixed="left" label="操作" width="150">
            <template slot-scope="scope">
              <el-button @click.native.prevent="insert(scope.row.FCATNO)" icon="el-icon-edit" type="text" size="small">
                编辑
              </el-button>
              <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit" />
        <Form ref="Form" :parelist="list" />
      </div>
    </div>
  </div>
</template>

<script>
  import Form from "./Form.vue"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,

        fvisiblelist: [
          { id: "1", fullName: "是" },
          { id: "2", fullName: "否" },
        ],
        total: 0,
        list: [
        {
          "FHOME":"闵行春申小学",
          "FYEAR": 2024,
          "FPARENTNO": "一年级",
          "FCATNO": "1001",
          "FCATNAME": "1班",
          "FPOINTNO": "奉1教楼101",
          "FSTUDNO": "化学系",
          "FTEACH": "秦始皇",
          "FNOTE": "第一还看我",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FHOME":"闵行春申小学",
          "FYEAR": 2024,
          "FPARENTNO": "一年级",
          "FCATNO": "1002",
          "FCATNAME": "2班",
          "FPOINTNO": "奉1教楼102",
          "FSTUDNO": "化学系",
          "FTEACH": "汉武帝",
          "FNOTE": "不服就干",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        },{
          "FHOME":"闵行春申小学",
          "FYEAR": 2023,
          "FPARENTNO": "一年级",
          "FCATNO": "2002",
          "FCATNAME": "3班",
          "FPOINTNO": "奉1教楼201",
          "FSTUDNO": "化学系",
          "FTEACH": "唐太宗",
          "FNOTE": "不打不相识",
          "FMEMO": "",
          "FVISIBLE": 1,
          "FOPERATOR": "system",
          "FUPDDATE": "2011-02-16T02:57:02.000+00:00"
        }
        ],

        //所属校区选择数据
        options1: [{
          value: 'L001',
          label: '大一'
        }, {
          value: 'L002',
          label: '大二'
        }, {
          value: 'L003',
          label: '大三'
        }, {
          value: 'L004',
          label: '大四'
        }],

        options2: [{
          value: 'L001',
          label: '化学系'
        }, {
          value: 'L002',
          label: '化工与材料系'
        }, {
          value: 'L003',
          label: '生物科学'
        }, {
          value: 'L004',
          label: '食品安全与检测'
        }],

        options3: [{
          value: 'L001',
          label: '显示'
        }, {
          value: 'L002',
          label: '隐藏'
        }],

        options4: [{
          value: 'L001',
          label: '化学与材料科学学院'
        }, {
          value: 'L002',
          label: '生命科学学院'
        }],

        options5: [{
          value: '20E01',
          label: '闵行春申小学'
        }, {
          value: '20E02',
          label: '闵行莘城中学'
        }, {
          value: '20N01',
          label: '闵行莘松中学'
        }, {
          value: '20N02',
          label: '闵行莘庄中学'
        }],

        loading: false,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fcatno: "",
          fcatname: ""
        },
      };
    },
    computed: {},
    created() {
    },
    methods: {
      insert(row) {
        this.$refs.Form.init(row);
      },
    },
  };
</script>